﻿using FriendStar.Code;
using FriendStar.Domain.Entity.BaseData;
using FriendStar.Domain.IRepository.BaseData;
using FriendStar.Repository.BaseData;
using System.Collections.Generic;
using System.Linq;
using SqlSugarRepository;

namespace FriendStar.Application.BaseData
{
    public class ZSJ_21_RQ_DatContainerApp
    {
        private IZSJ_21_RQ_DatContainerRepository service = new ZSJ_21_RQ_DatContainerRepository();
        public List<ZSJ_21_RQ_DatContainerEntity> GetList(string keyword)
        {
            var expression = ExtLinq.True<ZSJ_21_RQ_DatContainerEntity>();
            if (!string.IsNullOrEmpty(keyword))
            {
                expression = expression.And(t => t.FContainerNO.Contains(keyword));
            }
            return service.IQueryable(expression).OrderBy(t => t.FContainerID).ToList();
        }
        public List<ZSJ_21_RQ_DatContainerEntity> GetContainer(string UseUnit)
        {
            var expression = ExtLinq.True<ZSJ_21_RQ_DatContainerEntity>();
            if (!string.IsNullOrEmpty(UseUnit))
            {
                expression = expression.And(t => t.UseUnit.Contains(UseUnit));
            }
            return service.IQueryable(expression).Select(p=>new ZSJ_21_RQ_DatContainerEntity(){FContainerNO=p.FContainerNO,FContainerName=p.FContainerName}).OrderBy(t => t.FContainerNO).ToList();
        }
    }
}
  